package org.example.text;

/**
 * 储蓄账户
 */
public class SavingAccount extends Account{
    private double interestRate;

    public SavingAccount(){

    }

    public SavingAccount(long id, double balance, String password) {
        super(id, balance, password);
    }

    public double getInterestRate() {
        return interestRate;
    }

    public void setInterestRate(double interestRate) {
        if (interestRate > 0 && interestRate < 10){
            this.interestRate = interestRate;
        }
    }

    @Override
    public String toString() {
        return "SavingAccount{" +
                "interestRate=" + interestRate +
                '}';
    }
}
